package net.ru.topdog.lunchy.dao;

public abstract class DAOFactory {
	public static final int XML = 1;
	public static final int JDBC = 2;
	public static final int HIBERNATE = 3;

	public abstract DishDAO getDishDAO();
	public abstract TypeDAO getTypeDAO();

	public static DAOFactory getDAOFactory(int whichFactory,String configFile) {
		switch (whichFactory) {
		case XML:
			return new XMLDAOFactory(configFile);
		case JDBC:
			return new JDBCDAOFactory(configFile);
		case HIBERNATE:
			return new HibernateDAOFactory(configFile);
		default:
			return null;
		}
	}
}
